<?php
/*
 * mk script file created on 07-jul-2005
 * jaco_at_pixeldump_dot_org
 * inserting text
 */

include("sample_utils.php");                   // provides some utils and using mk

$swfFN = "test_mk_textfield01.swf";            // the file to generate

$tf = new MKTextField();                       // create new textfield,
                                               // default itemID = 2, fontID = 1
$tf->set_border();                             // border
$tf->set_multiline();                          // multiline
$tf->set_fontHeight(24);                       // 24px font height
$tf->set_width(300);                           // 300px width
$tf->set_height(200);                          // 200 px height
$tf->set_useOutlines();                        // use stored glyphs
$tf->set_text(":) smile\ryou're on mk!'");     // write some text
$tf->move(10, 40);
$tfTag = $tf->update_tagData();                // refresh binary data
$tfPB = $tf->update_place_tagData();                // refresh binary content

$fc = new MKFontContainer();                  // create "font" storage
$fc->load_mkfont_from_file("Lithograph.mkf");  // load "font" from file, it must exists
$fcTag = $fc->update_tagData();                // rebuild binary content

$swf = new MKSwf($swfFN);                      // create new swf
$swf->set_swfDir(SERVER_MKTMP);                // set working directory in tmp

$swf->add_tagData($fcTag);                     // populate with font
$swf->add_tagData($tfTag);                     // populate with textfield
$swf->add_tagData($tfPB);                      // populate with placing settings
$swf->swf_output();                            // write to disk

$swfHeader = $swf->fetch_assoc();              // prepare to publish

$str = render_swf_box($swfHeader, $imgDir, false);
$str .= "<br/><strong>" .$swfFN ." created in :<br />";
$str .= SERVER_MKTMP ."</strong><p>please note that textfield is editable</p></td></tr>";
echo show_content($str, basename(__FILE__));
?>
